package com.alticor.amwaychina.weibolib;

import android.app.Activity;
import android.support.annotation.DrawableRes;
import com.konylabs.android.KonyMain;
import com.sina.weibo.sdk.WbSdk;
import com.sina.weibo.sdk.auth.AuthInfo;

public class LaunchFFI {

    public static void shareWebPage(Activity activity , String title ,
                                    String description ,
                                    @DrawableRes int drawableResLogo,
                                    String actionUrl ,
                                    String defaultText) {
        WeiboShareUtil.shareWebPage(activity ,
                title,description ,drawableResLogo,actionUrl,defaultText);
    }
    /*
    share webpage call by kony
     */
    public static void shareWebPage( String title ,
                                    String description ,
                                    @DrawableRes int drawableResLogo,
                                    String actionUrl ,
                                    String defaultText) {
            WeiboShareUtil.shareWebPage(KonyMain.getActivityContext() ,
                    title,description ,drawableResLogo,actionUrl,defaultText);
    }

    /**
     * app start , call this function at mainActivity at kony
     */
    public static void install(){
        install(KonyMain.getActivityContext());

    }

    public static void install(Activity context){
        WbSdk.install(context,new AuthInfo(context, Constants.APP_KEY, Constants.REDIRECT_URL, Constants.SCOPE));
    }

    public static void shareLocalImage(Activity activity  ,String title, String text, String actionUrl, String localFilPath){
        WeiboShareUtil.shareLocalImage(activity , title,text, actionUrl , localFilPath);
    }

    /**
     * share image
     * @param localFilPath
     */
    public static void shareLocalImage( String title, String text, String actionUrl,String localFilPath){
        WeiboShareUtil.shareLocalImage(KonyMain.getActivityContext() ,title,text, actionUrl , localFilPath);
    }

    /**
     * share video
     * @param activity
     * @param localVideoPath
     */
    public static void shareVideo(Activity activity  ,String title, String text, String actionUrl, String localVideoPath){
        WeiboShareUtil.shareVideo(activity ,title,text, actionUrl , localVideoPath);
    }

    /**
     * share video  by kony call
     * @param localVideoPath
     */
    public static void shareVideo( String localVideoPath,String title,String text , String actionUrl){
        WeiboShareUtil.shareVideo(KonyMain.getActivityContext() ,title,text, actionUrl  ,localVideoPath);
    }

    /**
     * share text
     * @param activity
     */
    public static void shareText(Activity activity  , String title,String text , String actionUrl){
        WeiboShareUtil.shareText(activity , title,text,actionUrl);
    }

    /**
     * share text  by kony call
     */
    public static void shareText( String title,String text , String actionUrl){
        WeiboShareUtil.shareText(KonyMain.getActivityContext() ,title,text,actionUrl);
    }
}
